
find_package(BISON)
find_package(FLEX)


BISON_TARGET(CrimsonCore_Parser crimsoncore_glsl.y	${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
FLEX_TARGET(CrimsonCore_Scanner crimsoncore_glsl.l  ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
ADD_FLEX_BISON_DEPENDENCY(CrimsonCore_Scanner CrimsonCore_Parser)


set(CCSL_SOURCES
		ast.h
		main.cpp
		crimsoncore_glsl.l
		crimsoncore_glsl.y
		)

if(WIN32)
        configure_file(unistd.in.h unistd.h)
        set(CCSL_SOURCES
			${CCSL_SOURCES}
                        unistd.in.h
			)

endif()

include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_executable(
    CrimsonCore-ShadingLanguage
		test.input
		${CCSL_SOURCES}
		${BISON_CrimsonCore_Parser_OUTPUTS}
		${FLEX_CrimsonCore_Scanner_OUTPUTS}
    )
